﻿using System;
using System.Collections.Generic;
using SlimDX.D3DCompiler;

namespace HlslCompiler
{
    internal class Compiler11
        : ICompiler
    {
        public List<Feedback> Compile(string code, CompilerSettings settings)
        {
            var compilationErrors = string.Empty;
            try
            {
                ShaderBytecode.Compile(code, settings.EntryPoint, settings.Profile, settings.ShaderFlags, settings.EffectFlags, null, null, out compilationErrors);
            }
            catch (Exception)
            {
                
            }
            return FeedbackParser.Parse(compilationErrors);
        }
    }
}
